package com.cty.controller;

import com.cty.pojo.Picture;
import com.cty.service.PictureService;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;

/**
 * @Auther: com.cty
 * @Date: 2020/3/26 22:02
 * @Description:
 * @version: 1.0
 */
@Controller
public class PictureController {
    Logger log = Logger.getLogger(PictureController.class);

    @Resource
    private PictureService pictureServiceImpl;  // 按命名注入

    @RequestMapping("/")
    public String upload(Model model) {
        model.addAttribute("pictures", this.pictureServiceImpl.selAllService());
        log.info("已查询所有广告图");
        return "show";
    }

}
